using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace fenk.Ventas
{
    public partial class MenuFacturas : Form
    {
        private string selectionClause = string.Empty;
        private string invoiceType = string.Empty;
        public string SelectionClause
        {
            get
            {
                return selectionClause;
            }
        }
        public string InvoiceType
        {
            get
            {
                return invoiceType;
            }
        }
        public MenuFacturas()
        {
            InitializeComponent();
        }

        private void bManuales_Click(object sender, EventArgs e)
        {
            selectionClause = "WITH CODIGO = F] OR = G] OR = C] AND WITH BAJA # S AND WITH 4 = F";
            invoiceType = "Manuales F0/F3(A); G0/G3(B) o C0/C3(C.F.)";
            this.Close();
        }

        private void bElectronicas_Click(object sender, EventArgs e)
        {
            selectionClause = "WITH CODIGO = A] OR = B] AND WITH BAJA # S AND WITH 4 = F";
            invoiceType = "Electronicas A0/A3(A) y B0/B3(B)" ;
            this.Close();
        }

        private void bElectronicasExpo_Click(object sender, EventArgs e)
        {
            selectionClause = "WITH CODIGO = E] AND WITH BAJA # S AND WITH 4 = F";
            invoiceType = "Electronicas E0/E3(Exportacion A)";    
            this.Close();
        }

        private void MenuFacturas_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (selectionClause.Length == 0)
            {
                MessageBox.Show("Debe seleccionar un tipo de factura");
                e.Cancel = true;
            }
        }

        private void bWeb_Click(object sender, EventArgs e)
        {
            selectionClause = "WITH 2 = 0A OR = 0B AND WITH BAJA # S AND WITH 4 = F";
            invoiceType = "Web Service 0A/3A(A) y 0B/03 (B)";
            this.Close();
        }

        private void bWebExpo_Click(object sender, EventArgs e)
        {
            selectionClause = "WITH 2 = 0E AND WITH BAJA # S AND WITH 4 = F";
            invoiceType = "Web Service 0E/3E (Exportacion A)";
            this.Close();
        }

        
    }
}